package top.xiaoqiannb.shapelessdao.procedures;

import top.xiaoqiannb.shapelessdao.init.ShapelessdaoModMobEffects;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.core.BlockPos;

public class DiyouxiancheckProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
		if (entity == null)
			return;
		if ((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock() == Blocks.AIR) {
			if (entity instanceof LivingEntity _entity)
				_entity.removeEffect(ShapelessdaoModMobEffects.DIYOUXIAN.get());
			DiyouxianoffProcedure.execute(entity);
		}
	}
}
